<include file="Public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<script type="text/javascript"> 
jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件  
return this.each(function(){ 
var that; 
$('tr', this).each(function(row) { 
$('td:eq('+colIdx+')', this).filter(':visible').each(function(col) { 
if (that!=null && $(this).html() == $(that).html()) { 
rowspan = $(that).attr("rowSpan"); 
if (rowspan == undefined) { 
$(that).attr("rowSpan",1); 
rowspan = $(that).attr("rowSpan"); } 
rowspan = Number(rowspan)+1; 
$(that).attr("rowSpan",rowspan); 
$(this).hide(); 
} else { 
that = this; 
}  
}); 
}); 
}); 
}

$(function() {
	//$(".g_list").rowspan(5);
	$(".g_list").rowspan(0);
	$(".g_list").rowspan(1);
});

</script>
<div class="wrapper">
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i> 产品库存、价格明细</h3> <span style="color: red;">
		  </span>
        </div>
        <div class="panel-body">    
		<div class="navbar navbar-default">                    
                <form id="search-form2" class="navbar-form form-inline"  method="get" action="/index.php/Seller/Goods/chakan_kucun">
				<div class="form-group">
				  <div class="input-group">
				      <input type="text" name="goods_name" value="{:I('goods_name')}" id="goods_name" placeholder="产品名" class="input-sm">
				      </div>
				 </div>
				 <div class="form-group">
					 <input type="hidden" name="id" value="{:I('id')}">
				     <button type="submit" id="button-filter search-order" class="btn btn-primary"><i class="fa fa-search"></i> 筛选</button>
				      </div>
<!--                <div class="form-group" style="float: right;">    
                    <button type="button" class="btn btn-default pull-right" id="daochu"><i class="fa fa-file-excel-o"></i>&nbsp;导出excel</button>
                </div>   -->                              
                </form>    
          </div>                        
          <div id="ajax_return">                  
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover g_list">
                            <thead>
                            <tr>
								<th class="sorting text-center">ID</th>
                                <th class="sorting text-center">产品名</th>
                                <th class="sorting text-left">规格属性名</th>
                                <th class="sorting text-center">价格(可编辑)</th>
                                <th class="sorting text-center">库存(可编辑)</th>
                                <th class="sorting text-center">起批量(可编辑)</th>
								<th class="sorting text-center">SKU</th>
								<th class="sorting text-center">单位</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="goods_list" id="v">
                                <tr>
									<td class="text-center">{$v.goods_id}</td>
                                    <td class="text-center">{$v.goods_name}</td> 
									<td class="text-left">{$v.key_name}</td> 
                                    <td class="text-center" style="color:#f39c12;">
										<input type="text" onchange="updateSort2('spec_goods_price','key','{$v.key}','price',this)" size="4" value="{$v.price}" style="width: 90px"/>
									</td>
                                    <td class="text-center" style="color:blue;">
									<input type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onchange="updateSort2('spec_goods_price','key','{$v.key}','store_count',this)" size="4" value="{$v.store_count}" style="width: 90px"/>
									</td>
                                    <td class="text-center" style="color:red;">
									<input type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onchange="updateSort2('spec_goods_price','key','{$v.key}','qipi_num',this)" size="4" value="{$v.qipi_num}" style="width: 90px"/>
									</td>
									<td class="text-center">
									<input type="text" onchange="updateSort2('spec_goods_price','key','{$v.key}','sku',this)" size="4" value="{$v.sku}" style="width: 90px"/> 
									</td>
									<td class="text-center">
									<input type="text" onchange="updateSort2('spec_goods_price','key','{$v.key}','spu',this)" size="4" value="{$v.spu}" style="width: 50px"/>
									</td>
                                    <!--<td class="text-left"><a href="{:U('Admin/Distribut/editWithdrawals',array('id'=>$v[withdrawals_id]))}">查看</a></td>-->
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                    </div>
                
                <div class="row">
                    <div class="col-sm-6 text-left"></div>
                    <div class="col-sm-6 text-right">{$show}</div>
                </div>
          
          </div>
        </div>
      </div>
    </div>
    <!-- /.row --> 
  </section>
  <!-- /.content --> 
</div>
<!-- /.content-wrapper --> 
 <script>
 
$(document).ready(function() {
	$('#create_date').daterangepicker({
		format:"YYYY-MM-DD",
		singleDatePicker: false,
		showDropdowns: true,
		minDate:'2020-01-01',
		maxDate:'2030-01-01',
		startDate:'{:date("Y-m-d H:i")}',
        showWeekNumbers: true,
        timePicker: false,
        timePickerIncrement: 1,
        timePicker12Hour: true,
        ranges: {
           '今天': [moment(), moment()],
           '昨天': [moment().subtract('days', 1), moment().subtract('days', 1)],
           '最近7天': [moment().subtract('days', 6), moment()],
           '最近30天': [moment().subtract('days', 29), moment()],
           '上一个月': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
        },
        opens: 'right',
        buttonClasses: ['btn btn-default'],
        applyClass: 'btn-small btn-primary',
        cancelClass: 'btn-small',
	    locale : {
            applyLabel : '确定',
            cancelLabel : '取消',
            fromLabel : '起始时间',
            toLabel : '结束时间',
            customRangeLabel : '自定义',
            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
            firstDay : 1
        }
	});
		$("#daochu").click(function(){
			alert('敬请期待。。。');return false;
			var order_sn=$("#order_sn").val();
			var consignee=$("#consignee").val();
			var add_time=$("#add_time").val();
			var order_status=$("#order_status").val();
			location.href="/index.php/Admin/order/export_order?order_sn="+order_sn+"&consignee="+consignee+"&timegap="+add_time+"&order_status="+order_status;
		})
});
</script>
</body>
</html>